package cn.zhx.domain.strategy.service;

import cn.zhx.domain.strategy.model.valobj.StrategyAwardStockKeyVO;

/**
 * @Author: zhx
 * @Date: 2024/07/12
 * @Description: 抽奖库存
 **/
public interface IRaffleStock {

    /**
     * 获取奖品库存消耗队列
     * @return 奖品库存消耗队列
     * @throws InterruptedException
     */
    StrategyAwardStockKeyVO takeQueueValue() throws InterruptedException;

    /**
     * 更新奖品库存消耗记录
     * @param strategyId 策略ID
     * @param awardId 奖品ID
     */
    void updateStrategyAwardStock(Long strategyId, Integer awardId);

    /**
     * 清空队列
     */
    void clearQueueValue();


    /**
     * 缓存库存以消耗完毕，清空数据库库存
     * @param strategyId 策略ID
     * @param awardId 奖品id
     */
    void clearStrategyAwardStock(Long strategyId,Integer awardId);
}
